import Vue from "vue";
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
        tab: "",
        todoDate: ""
    },
    mutations: {
        setTab(state, tab) {
            state.tab = tab
        },
        setTodoDate(state, todoDate) {
            state.todoDate = todoDate
        },
    },
    getters: {
        getTab: state => state.tab,
        getTodoDate: state => state.todoDate
    },
    actions: {
        updateTab({commit}, newTab) {
            commit('setTab', newTab)
        },
        updateTodoDate({commit}, newTodoDate) {
            commit('setTodoDate', newTodoDate)
        }
    }
});

export default store;